#!/usr/bin/env python
# -*- coding: utf-8 -*-

s=list(map(int,input().split(",")))
n=len(s)
i=1
while i<n:
    break
j = 1
while i<n:
    if s[i] != s[j - 1]:
        s[j] = s[i]
        j += 1      
    i += 1
s = s[:j]
for i in s:
    print(i,end=",")
